<template>
  <div class="echart_box">
    <div class="top_title">
      <div class="line"></div>
      <div class="title_value">考试系统数据综合统计</div>
      <div class="line"></div>
    </div>

    <div class="echart_bottom">
      <div class="chart_left">
        <TestExamBuild />
        <CurriculumRate />
      </div>
      <div class="center_box">
        <NumberCount :number="numCount" />
        <CourseDetail />
        <ExamQuality />
      </div>
      <div class="chart_right">
        <ExamPassRate />
      </div>
    </div>
  </div>
</template>

<script>
import TestExamBuild from './main/TestExamBuild'
import CurriculumRate from './main/CurriculumRate'
import NumberCount from './main/NumberCount'
import CourseDetail from './main/CourseDetail'
import ExamQuality from './main/ExamQuality'
import ExamPassRate from './main/ExamPassRate'

export default {
  components: {
    TestExamBuild,
    CurriculumRate,
    NumberCount,
    CourseDetail,
    ExamQuality,
    ExamPassRate,
  },
  data() {
    return {
      numCount: 10000,
    }
  },
  mounted() {
    clearInterval(this.timer)
    this.timer = setInterval(() => {
      this.numCount = this.numCount + parseInt(Math.random() * 10)
    }, 2000)
  },
  methods: {},
  beforeDestroy() {
    clearInterval(this.timer)
  },
}
</script>

<style lang="scss" scoped>
.echart_box {
  width: 100%;
  height: 100vh;
  padding: 10px 20px;
  overflow: hidden;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    rgba(14, 31, 83, 1) 0%,
    rgba(14, 31, 83, 1) 0%,
    rgba(38, 86, 126, 1) 48%,
    rgba(15, 35, 86, 1) 100%,
    rgba(15, 35, 86, 1) 100%
  );
  .top_title {
    width: 100%;
    height: 8vh;
    display: flex;
    .title_value {
      width: 50%;
      height: 50px;
      text-align: center;
      line-height: 50px;
      color: #ace8f8;
      background: url('../assets/images/main/title_bg.svg') no-repeat;
      background-size: 100% 100%;
      font-size: 1.25rem;
      font-weight: 700;
    }
    .line {
      width: 25%;
    }
    img {
      height: 87px;
    }
  }
  .echart_bottom {
    display: flex;
    justify-content: space-around;
    height: 92vh;
    width: 100%;
    > div {
      display: flex;
      flex: 1;
    }
    .chart_left {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 95%;
    }
    .center_box {
      display: flex;
      // width: 40%;
      // flex-direction: column;
      align-items: center;
      flex-direction: column;
    }
    .chart_right {
      height: 95%;
    }
  }
}
</style>
